import requests

from conmon.Db_util import DButil
from conmon.token_util import get_token


def get_id():
    sql = "delete from bs_user where id='1666239913642561536';"
    sql1 = "insert into bs_user (id,username,mobile,workNumber) values('1666239913642561536','zhangsan','15800000010','8885');"
    DButil().sql_perform(sql)
    DButil().sql_perform(sql1)

    res_id = requests.post(url="http://ihrm-test.itheima.net/api/sys/user",
                             headers={"Content-Type": "application/json;charset=UTF-8", "Authorization": get_token()},
                             json={"username": "zhangsan",
                                   "mobile": "15800000010",
                                   "workNumber": "100"})
    return res_id.json()["data"]["id"]
